home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Medal Software 3
/
Gold Medal Software - Volume 3 (Gold Medal) (1994).iso
/
comms
/
icom0425.arj
/
SCRDEMO.SCR
< prev
next >
Wrap
Text File
|
1994-04-25
|
27KB
|
636 lines
;----------------------------------------------------------------------------
; SCRDEMO.SCR Intellicomm v2 script language demonstration.
;----------------------------------------------------------------------------
gosub Initialize
gosub MainMenu
gosub FindScriptDOC
goto ExitDemo
;----------------------------------------------------------------------------
Initialize:
;----------------------------------------------------------------------------
variable lstat_on $STAT_ON ;save original state of status line
variable lscrn_color $SCRN_COLOR ;save original screen color
variable i ;for general purpose
variable s
variable last_selection 1 ;for main menu, holds the last selection
variable SCRTUTOR "SCRTUTOR.DOC" ;the script tutorial document
variable fspec "\*.*"
variable size
variable key
variable tag
variable name
variable date
variable desc
variable catalog "NEWFILES"
variable m1 "~Welcome!" ;main menu options (for use below)
variable m2 "~Interactive Commands"
variable m3 "~DOS/File Commands"
variable m4 "~Catalog Commands"
variable m5 "R~un another Script"
variable m6 "D~OS File Manager"
variable m7 "~Jump to DOS Shell"
variable m8 "e~Xit"
vpush ;video push (save the screen)
assign $STAT_ON 0 ;shut off the status line
assign $SCRN_COLOR $NORM_COLOR ;use the regular Icom menu color on-screen
cls
return
;----------------------------------------------------------------------------
CleanUp:
;----------------------------------------------------------------------------
vpop ;restore the screen
assign $STAT_ON lstat_on ;restore the status line (if it was on)
return
;----------------------------------------------------------------------------
PressKey:
;----------------------------------------------------------------------------
pause "^M^J^BPlease press a key...^B "
cls
return
;---------------------------------------------------------------------------
MainMenu:
;---------------------------------------------------------------------------
strset s "░" 0 $SCRN_WIDTH ;fill 's' with ░, to the screen width
;PRINTRAW is much faster than PRINT
assign i 1
while i <= $SCRN_HEIGHT
printraw 1 i $NORM_COLOR s
inc i
endwhile
eraseline 1 $STAT_COLOR
printraw -1 1 $STAT_COLOR "Intellicomm v2.0 Script Demonstration"
menudefine m1 m2 "-" m3 m4 "-" m5 m6 m7 m8
;the MENUHLP command attaches help to a menu item so that when the
; user hilights the item, the help is displayed.
menuhlp 1 "Welcome to the Intellicomm v2 Script Demonstration!"
menuhlp 2 "Preview the script user-interactive features"
menuhlp 3 "Preview the DOS and file-oriented script features"
menuhlp 4 "Preview the script File Tagger catalog handling features"
menuhlp 5 "Demonstrates interactive script running from within a script"
menuhlp 6 "Demonstrates interactive file handling from within a script"
menuhlp 7 "Demonstrates use of the DOS 'shell' feature from within a script"
menuhlp 8 "Exit the script demonstration"
menuboxv "SCRDemo Main Menu" "Select a Demonstration" last_selection
;the item selected is stored in the System Variable $MENUSELECTION
; if 1, menu item 1 (Welcome!) was selected, and so forth. If 0
; then the user pressed ESC or clicked the mouse outside of the
; menu.
assign last_selection $MENUSELECTION ;save for next menu display
switch $MENUSELECTION
case 1
gosub Welcome
endcase
case 2
gosub InteractiveDemo
endcase
case 3
gosub DOSDemo
endcase
case 4
gosub CatDemo
endcase
case 5
gosub RunScript
endcase
case 6
FileMan ;call the File Manager (default directory)
endcase
case 7
Dos ;DOS shell (when no command given)
endcase
default ;ESC pressed (0) or eXit (item 11) selected
return
endswitch
goto MainMenu ;re-display the menu
;----------------------------------------------------------------------------
Welcome:
;----------------------------------------------------------------------------
;You'll see ^B and ^M^J here and there in the text below. ^B (Ctrl-B)
; toggles 'bold' text on/off, while ^M^J (Ctrl-M, Ctrl-J) prints a
; Carriage Return, Line Feed to advance the cursor down a line leaving a
; BLANK line.
cls
print "^M^JWelcome to the exciting world of ^BIntellicomm scripts^B!^M^J"
print "This demonstration will show you some (but not all) of the things you can do"
print "with scripts. Icom's script language is very rich and powerful and it"
print "includes many features that you won't find anywhere else, in ^BANY^B script"
print "language! Discover the language piece by piece, as time permits: You'll soon"
print "find yourself able to do some truly incredible things that will surely give"
print "you great satisfaction and will increase your enjoyment of, and control over,"
print "Intellicomm."
strset s "─" 0 78 ;put 78 "─" characters in variable 's' (a line)
print s ;print the line
print "The main purpose of scripts is to automate tasks that Intellicomm doesn't"
print "currently support with its automated jobs. You can dial BBS's and automate"
print "just about anything you can imagine, or can ^bintegrate^B your scripts with"
print "Icom's automated jobs and BIFs... so that Icom does the dialing, logon and"
print "logoff, and you just handle the tasks you want done in between. All of this"
print "and much more is outlined in the first ten or so pages of ^B" SCRTUTOR "^B and"
print "is absolutely and positively worth a read!^M^J"
print "[^BNOTE:^B To abort this demonstration (or any script) at any time, press"
print "the ^B[Alt-Q]^B key, then select ^"^BAbort Script Only^B^" from the Alt-Q"
print "menu.]"
gosub PressKey ;subroutine PressKey is defined below.
print "No matter how inexperienced you are with programming (script or otherwise)"
print "there is simply no way you can FAIL to learn at least ^Bsome^B of the useful"
print "script language features, if you spend half-an-hour with ^B" SCRTUTOR "^B."
print "If you can read and understand this text on-screen, you won't have to stretch"
print "very far to understand many of the script commands. There ^Bare^B some script"
print "features that are designed for more advanced users, but for the most part"
print "anyone can learn script basics. And the basics are very powerful and useful"
print "indeed! You're simply cheating yourself out of much enjoyment and satisfaction"
print "if you choose to avoid scripts.^M^J"
print "None of the script 'online' or communications functions are demonstrated"
print "here, simply because it's nearly impossible to write a script to dial a"
print "BBS or to logon/perform some tasks without prior knowledge of the BBS."
print "^BYou^B will be able to accomplish a great deal in that area, once you get"
print "a specific BBS and task in mind and once you give ^B" SCRTUTOR "^B the once-"
print "over. In this demonstration we'll be showing you only some of the"
print "interesting visual and input functions available.^M^J"
print "You're already looking at some basic video output, but you can certainly"
print "perform much more interesting video output with scripts."
gosub PressKey
WNDOPEN "Window 1" ;no coordinates opens a full-screen window.
WNDOPEN "Window 2" 10 5 70 20 ;x1,y1, x2,y2 screen coordinates
WNDOPEN "Window 3" 1 1 80 5
WNDOPEN "Window 4" 1 6 80 10
WNDOPEN "Window 5" 1 11 80 15
WNDOPEN "Window 6" 1 16 80 20
WNDOPEN "Window 7" 1 21 80 25
WNDOPEN "WNDOPEN" 3 3 78 23
print "The ^BWNDOPEN^B command opens a box with a border and allows you to print"
print "information without worrying about where the box limits are. ^BWNDOPEN^B"
print "automatically sets the current WINDOW to within the box borders so"
print "when you use ^BCLS^B to clear the screen, or ^BPRINT^B/^BPRINTNC^B (^BNC^B=No CR),"
print "only the space within the box is affected. ^BWNDOPEN^B also does all of"
print "the following:^M^J ^B^B"
print " ■ Saves the current screen information (and colors) under the box"
print " for later restoration with ^BWNDCLOSE^B.
print " ■ Saves the current ^B$SCRN_COLOR^B (screen color) value and current X"
print " and Y coordinates of the cursor, again restored when ^BWNDCLOSE^B is"
print " executed."
print " ■ Displays a box with optional title, using the regular Icom colors."
print " ■ Automatically executes a ^BWINDOW^B command to set the logical screen"
print " within the box borders. ^BNOTE:^B the 'logical' screen is also"
print " observed when displaying data from the COM port, so you can also"
print " cause BBS output to be displayed within a window!"
gosub PressKey
print "Note how the ^BCLS^B (clear screen) command affects only the current"
print "window. ^BCLS^B was used to clear the window after you pressed a key."
print "To close windows opened with ^BWNDOPEN^B and restore the previous screen"
print "color and cursor coordinates, simply call ^BWNDCLOSE^B."
gosub Presskey
WNDCLOSE
print "Now we have returned to the previous window."
gosub PressKey
WNDCLOSE
print "Another call to ^BWNDCLOSE^B closes this window."
gosub PressKey
WNDCLOSE
print "Another call to ^BWNDCLOSE^B closes this window."
gosub PressKey
WNDCLOSE
print "And another."
gosub PressKey
WNDCLOSE
print "And another."
gosub PressKey
WNDCLOSE
print "And another."
gosub PressKey
WNDCLOSE
print "And now we're back at the first window we opened. The final ^BWNDCLOSE"
print "will return us to the Main Menu."
gosub PressKey
WNDCLOSE
return
;----------------------------------------------------------------------------
InteractiveDemo:
;----------------------------------------------------------------------------
wndopen "Interactive Commands"
print "This section demonstrates some of the 'interactive' commands available."
print "Using these commands your script can interact with the user just as this"
print "demonstration (which is run entirely BY a script) is interacting with you.^M^J"
print "With the ^BINKEY^B and ^BINKEYW^B (^BW^B for Wait) commands you can get a key"
print "from the keyboard and check it to see which key was pressed.^M^J"
printnc "Please press ^BF2^B to continue: "
while 1 ;WHILE 1 loops forever (or until a BREAK)
inkeyw i ;wait for a keypress, store in 'i'
if i = 15360 ;if i equals F2 (15360 is the keycode)
print "^M^JThank you for pressing the ^BF2^B key."
delay 25 ;pause for 2.5 seconds (25 tenths)
break ;BREAK exits the while loop
endif
beep
gotoxy 1 $SCRN_Y ;column 1, same line (over the previous prompt)
printnc "That wasn't the ^BF2^B key. Please try again: "
endwhile
cls
print "You can also get several characters of input from the keyboard using"
print "^BBOXGETS^B, which displays a box with optional help line, or with"
print "^BGETS^B which just displays the input field without a box. You can"
print "also offer a default response which the user can edit using the usual"
print "cursor editing keys (^BIns^B, ^BDel^B, ^BLeft^B, ^BRight^B, ^BHome^B, ^BEnd^B, etc)."
print "If a 'non-editing' key is pressed, the default is cleared from the input"
print "field."
assign s "This is the default response"
boxgets s 40 "Input Box Courtesy of BOXGETS" "Enter something in the input field, or press [Esc]"
print
switch $ERRORLEVEL ;BOXGETS sets $ERRORLEVEL to 0 if something entered
case 0
;note here how multiple items are printed with a single PRINT command
; ...first we print "You entered '" and turn bold on, then we print
; variable s, then turn bold off and print the closing ' and a period.
print "You entered '^B" s "^B'."
endcase
case 1
print "You entered nothing in the input field."
endcase
case 2
print "You pressed the ^BEsc^B key!"
endcase
endswitch
print "^M^JYou can also get input via a menu using the ^BMENUBAR^B command:"
printnc "Are you gaining interest in scripts? "
menudefine "~Yes" "~No" ;define a Yes No menu (~ = hotkeys)
menubar ;display the menu and get the input
;MENUBAR (and MENUBOXH, MENUBOXV) set $MENUSELECTION to either the menu
; item selected (1 for the 1st item: Yes, 2 for the 2nd item: No), or
; set it to 0 if the user pressed the ESC key.
if $MENUSELECTION <> 1 ;not equal to 1 (Yes)?
print "I'm sorry to hear that." ;the user selected "No" or [Esc]
printnc "Would you like to quit? "
menubar ;<-- No need to MENUDEFINE for same one
if $MENUSELECTION = 1 goto ExitDemo ;user wants to exit... the nerve. <grin>
endif
print "^BGood!^B I'm glad to hear it."
print "^M^JYou can also attach help to each menu item similar to Icom's bar menus:^M^J"
menudefine "Option ~1" "Option ~2" "Option ~3" "e~Xit"
menuhlp 1 "Press the [Left] and [Right] arrow keys to see this menu work"
menuhlp 2 "This would be a description of Option 2"
menuhlp 3 "And this would be a description of Option 3"
menuhlp 4 "Exit this menu"
menubar
cls
print "You can get input via two types of 'box' menus using the ^BMENUBOXH^B"
print "(horizontal menu in a box) and ^BMENUBOXV^B (vertical menu in a box):"
;we're using different menu options here, so MENUDEFINE is called again
; to redefine the menu. If we were going to use the "Yes/No" menu we
; defined earlier though, we could skip the MENUDEFINE. It need only
; be called to define a NEW menu (the Yes/No menu is replaced with this
; MENUDEFINE
menudefine "Item ~1" "Item ~2" "Item ~3"
menuboxh "Box Menu courtesy of MENUBOXH" "Optional help line"
;you can test MENUSELECTION in any order... it isn't necessary to check
; 0 first... you could check 3, then 1, then 0, then 2 if you wanted
if $MENUSELECTION = 0 print "You pressed the ^BEsc^B key!"
if $MENUSELECTION = 1 print "You selected ^BItem 1^B."
if $MENUSELECTION = 2 print "You selected ^BItem 2^B."
if $MENUSELECTION = 3 print "You selected ^BItem 3^B."
cls
print "You can also move the optional help line to the same line as the menu:"
;with a TAB (^I) as the first character of the help, MENUBOXH
; displays the help on the same menu line
menuboxh "Also courtesy of MENUBOXH" "^IEnter selection:"
cls
print "You can also 'hide' and disable menu options at will. Here's a vertical"
print "box menu with some menu items hidden. If you select '^BEnable more Options^B'"
print "more menu selections will be displayed."
menudefine "Option ~1" "Option ~2" "~Enable more Options" "-" "Option ~3" "Option ~4"
menuitemstat 4 2 ;4 is the menu item, 2 means to hide it (1 disables)
menuitemstat 5 2 ;hide item 5
menuitemstat 6 2 ;hide item 6
menuboxv "Box Menu courtesy of MENUBOXV"
if $MENUSELECTION = 3 ;3 is the 'Enable more Options' item
menuitemstat 3 1 ;1 disables item 3
menuitemstat 4 0 ;0 means to UNhide and enable an item
menuitemstat 5 0
menuitemstat 6 0
cls
print "Two more menu items and a menu divider line which were previously hidden have"
print "now been displayed. And ^BEnable more Options^B has been disabled."
menuboxv "Same Menu courtesy of MENUBOXV" "Divider lines can also be hidden"
endif
;regardless of whether items are hidden or disabled, $MENUSELECTION is
; ALWAYS set to the same menu item number, as if the items were not hidden
; (ignoring menu lines though). So 3 is still 'Enable more Options', 4 is
; 'Option 3', etc., regardless of what is actually displayed on the screen.
; Thus you needn't "keep track" of which items you've hidden and which
; you haven't (the user simply cannot see or select a hidden item).
print
if $MENUSELECTION = 0 print "You pressed the ^BEsc^B key!"
if $MENUSELECTION = 1 print "You selected ^BOption 1^B."
if $MENUSELECTION = 2 print "You selected ^BOption 2^B."
if $MENUSELECTION = 4 print "You selected ^BOption 3^B."
if $MENUSELECTION = 5 print "You selected ^BOption 4^B."
gosub PressKey
cls
print "There are also several 'pre-fabricated' interactive commands available."
print "Many script commands which take arguments or 'parameters' will prompt the"
print "user for input if you omit the key parameter. For example the ^BDOWNLOAD^B"
print "command is normally followed by a protocol letter (^BDOWNLOAD ^"Z^"^B downloads"
print "using Zmodem). If you omit the protocol letter, Icom displays the protocol"
print "menu and allows the user to select the protocol. The same applies to all"
print "these commands, if you omit the key parameter:^M^J"
print "^BDIAL^B Displays the BBS Directory, allows one or more BBS's to be dialed."
print "^BDOWNLOAD^B Prompts the user for a protocol and/or the filename to download."
print "^BFILEMAN^B Displays the File Manager (any filespec; C:\ICOM\*.BAT, etc)"
print " and allows the user to Copy, Move, Rename, Delete files, or"
print " to search the disk for a file."
print "^BUPLOAD^B Prompts the user for a protocol and/or the filename(s) to upload."
print "^BSCRIPT^B Displays the Script Manager, allows the user to select one or"
print " more scripts to run."
print "^BSENDKEYS^B Sends ^Bany^B keystrokes to the Icom key handler to display any"
print " Icom menu and to even send specific keys to the menu (macros)."
print "^BSETCOMM^B Displays the Port Settings menu to change port speed, etc."
gosub PressKey
print "There are also a few interactive File Tagger-oriented commands which"
print "allow you to display records for Editing (^BCEDITREC^B) and to prompt the"
print "user for a new sort order (^BCSETSORT^B), or to prompt for a text file"
print "and/or BIF to import or export records to (^BCEXPORT^B, ^BCIMPORTTEXT^B)."
print "With these interactive commands, and all the menu and regular keyboard"
print "input functions, along with other script commands, you can easily define"
print "quite sophisticated user interfaces for your scripts!^M^J"
print "Of course, you don't have to interact with the user at all if you don't want"
print "to (or don't have to). That's the whole point of scripts: everything is"
print "designed by ^Byou^B, so Intellicomm operates as you see fit. You run the"
print "entire show."
gosub PressKey
WNDCLOSE
return
;----------------------------------------------------------------------------
DOSDemo:
;----------------------------------------------------------------------------
wndopen "DOS/File Commands"
print "Using the DOS-oriented script commands, you can do anything from displaying"
print "a directory to copying, renaming, moving or deleting files, to searching"
print "an entire disk for a file, to running Lotus from a script.^M^J"
print "The ^BFINDFIRST^B command takes any filespec (drive, path and/or filename"
print "including wildcard ^B*^B/^B?^B support) and locates the first matching file."
print "To obtain the next file matching the filespec (if any) ^BFINDNEXT^B is used."
print "FINDFIRST/FINDNEXT also set certain script variables to allow you to"
print "check the size, date, time, and attributes of the file (read only, hidden,"
print "system, subdirectory, archive attribute).^M^J"
print "We'll use FINDFIRST/FINDNEXT to show you all files in your root directory,"
print "including any hidden files."
gosub PressKey
wndclose
findfirst name fspec 8 ;8 = get the Volume ID
assign s "Filespec " fspec " on Volume " name
wndopen s 1 1 80 25
print " ^BFilename Size Date Time RHSA^B"
window 3 3 79 24 ;to lock the title above (which is on row 2)
assign i 0
FINDFIRST name fspec 23 ;23 = all attributes except Volume ID
WHILE $errorlevel = 0
strpad name " " 12 ;pad right side w/spaces up to 12 chars
if $FSUBDIR = "+" ;is this file a subdirectory?
assign size " <DIR>"
strpad size " " 10 ;pad right side w/spaces up to 10 chars
else
assign size $FSIZE
strpadl size " " 10 ;pad left side w/spaces up to 10 chars
endif
print name size " " $FDATE " " $FTIME " " $FRDONLY $FHIDDEN $FSYSTEM $FARCH
inc i
if i = 21
pause "^BPress a key... "
cls
assign i 0
endif
FINDNEXT name
ENDWHILE
pause "^BPress a key... "
wndclose
return
;----------------------------------------------------------------------------
CatDemo:
;----------------------------------------------------------------------------
wndopen "Catalog Commands"
print "The catalog-oriented script commands allow you to directly manipulate any"
print "File Tagger catalog. You can access and modify (or display, or do anything"
print "else you can dream up) each and every 'record' in the catalog. You can"
print "tag files (based on some automated criteria such as keywords in the file"
print "description or the like) with ^BCTAGREC^B, you can note files with ^BCNOTEREC^B:"
print "You can basically do anything the File Tagger can do -- but you can do it"
print "AUTOMATICALLY via a script, instead of doing it manually in the Tagger.^M^J"
print "To access a catalog you simply open it with ^BCOPEN^B, set the sort order (if
print "desired) with ^BCSETSORT^B, then use ^BCGETREC^B to load individual records
print "from the catalog. We'll do just that right now to your ^BNEWFILES^B catalog
print "to display it. Press the ^B[Esc]^B key when you've seen enough.
gosub PressKey
wndclose
wndopen catalog 1 1 80 25
copen catalog
csetsort ;no sort order specified, prompts user for
; sort order
print " ^BFilename Date Description^B"
window 2 3 79 24
assign $KEY_CHECK 0 ;or the script processor gobbles up most keys
; before INKEY sees it
WHILE 1
inkey key
if key = "^[" break ;^[ = ESC
cgetrec
if $errorlevel <> 0 break ;end of catalog
assign tag " " ;default (untagged)
if $CTAG_FLD = "T" assign tag "^P"
if $CTAG_FLD = "N" assign tag "»"
assign name $CNAME_FLD
strpad name " " 14 ;pad the name field with spaces to 14 chars
cdate2date date $CFDATE_FLD
cgetdesc desc 1
print "^B" tag "^B" name date " " desc
ENDWHILE
assign $KEY_CHECK 1
cclose
pause "^M^J^BPress a key..."
wndclose
return
;----------------------------------------------------------------------------
RunScript:
;----------------------------------------------------------------------------
wndopen "Run another Script"
print "When you run a script ^Bfrom^B a script, or call up the Script Manager to"
print "run another script as we'll be doing here, it is possible to exit the"
print "script processor (and this demonstration) entirely. Two commands end"
print "a script: ^BRETURN^B and ^BEXIT^B. If the script you run contains an"
print "^BEXIT^B command, you will exit the script processor entirely (which"
print "can be handy in your own scripts, when an error warrants it). If the"
print "script you run exits via a ^BRETURN^B command, you will return to the"
print "Main Menu of this demonstration. ^B" $SCRIPT_NAME "^B exits with an ^BEXIT^B"
print "command, so you will exit the script processor entirely if you run
print "another copy of ^B" $SCRIPT_NAME "^B.^M^J"
pause "Press a key to enter the Script Manager... "
script ;no scriptname given... this calls up the Script Manager
pause "Welcome back to SCRDemo!. Any key returns to the Main Menu... "
return
;----------------------------------------------------------------------------
FindScriptDOC:
;----------------------------------------------------------------------------
wndopen
print "There's much ^BMUCH^B more to scripts than was demonstrated here, and"
print "you'll discover all the tricks of the trade by spending a few minutes"
print "with ^B" SCRTUTOR "^B. In fact, I can take a look on-disk for ^B" SCRTUTOR
print "right now if you like, and display it for you to take a quick peek at.^M^J"
print "Using the script ^BDISKFIND^B command, scripts can search the entire"
print "disk drive for a file (or filespec... ^B*.DOC^B for example), and
print "using the script ^BLIST^B command, files can be displayed for viewing.^M^J"
printnc "Okay to look for ^B" SCRTUTOR "^B and display it? "
menudefine "~Yes" "~No" ;define a Yes No menu
menubar ;activate the menu
if $MENUSELECTION = 1
msgopen "Searching disk for " SCRTUTOR
diskfind s SCRTUTOR ;if found, the full pathname is stored in 's'
msgclose
if $ERRORLEVEL = 0
print "^M^J^JWell, I found: ^B" s
pause "I hope it's the right ^B" SCRTUTOR "^B! <grin> Press a key to view it... "
timer ;time how long the user spends in SCRTUTOR.DOC
LIST s ;display the file
timertotal i ;store total time (in tenths of a second) in v1
div i i 10 ;i = i divided by 10 (convert tenths to seconds)
print "^M^JYou spent ^B" i "^B seconds in ^B" SCRTUTOR "^B, according to ^BTIMER^B / ^BTIMERTOTAL^B."
pause "I hope you found it interesting! Please press a key to continue... "
else
msgwind "Unable to locate " SCRTUTOR ;MSGOPEN, delay, MSGCLOSE
print "^M^JCheck your original disks (or .ZIPs). " SCRTUTOR "should have been"
print "included with Intellicomm, but you may have chosen not to install the"
print "documentation when you installed Intellicomm."
pause
endif
endif
wndclose
return
;----------------------------------------------------------------------------
ExitDemo:
;----------------------------------------------------------------------------
cls
wndopen "Thanks for watching!"
print
print "This concludes the demonstration. To see how the all the features of this"
print "demonstration were accomplished, just ^BEdit^B SCRDEMO.SCR from the Icom"
print "^BScript Manager^B. Bye for now!^M^J"
pause "Press a key to exit... "
wndclose
gosub CleanUp
exit